<?php
/**
 * Created by PhpStorm.
 * User: 小灰灰
 * Date: 2023-11-16
 * Time: 14:59:50
 * Info: 幻灯片分类
 */
declare(strict_types=1);

namespace app\common\model;

class SlideCate extends TimeInit
{

    /**
     * 获取数量
     * @return int
     */
    public static function getCount(): int
    {
        $count = self::where(['status' => 1])->count();

        return $count;
    }

    /**
     * 获取数据列表
     * @return array
     */
    public static function getList(int $page = 1, int $limit = 10): array
    {
        $first = ($page - 1) * $limit;
        $list  = self::where(['status' => 1])->limit($first, $limit)->select()->toArray();

        return $list;
    }
}
